if SERVER then
	registerCommand("freeze", "Turn on/off the player you specify being frozen", function(param)
		local freezeOn = "caller froze target"
		local freezeOff = "caller unfroze target"
		if param["settings"]["freeze_msg_on"] then
			freezeOn = param["settings"]["freeze_msg_on"]
		end
		if param["settings"]["freeze_msg_off"] then
			freezeOff = param["settings"]["freeze_msg_off"]
		end
		local freezeTable = {}
		
		local freezeTexts =
		{
			nil,
			"phoenix_storms/fender_white",
			"models/props/cs_office/snowmanA",
			"Models/effects/splodearc_sheet"
		}
		if param["settings"]["freeze_texture"] then
			freezeTexts[1] = param["settings"]["freeze_texture"]
		end
		local useText = ""
		for i, text in pairs(freezeTexts) do
			if text then
				//print("PATH: " .. "../materials/" .. text .. ".vtf")
				if file.Exists("../materials/" .. text .. ".vtf") then
					useText = text
					break
				elseif i == table.Count(freezeTexts) then
					useText = text
					break
				end
			end
		end
		
		freezeTable["caller"] = getCaller(param[1])
		local targs = string.Explode(" ", param[3])
		for i, targ in pairs(targs) do
			local plyTarg = getPlayerByName(targ)
			if plyTarg then
				freezeTable["target"] = plyTarg:GetName()
				if (not plyTarg["moocow_freze"]) || plyTarg["moocow_freze"] == -1 then
					display(param[1], "freeze", { plyTarg }, parseDisplayMessage(freezeOn, freezeTable))
					plyTarg["moocow_freze"] = 1
					plyTarg:Lock()
					plyTarg["moocow_plymat"] = plyTarg:GetMaterial()
					plyTarg["moocow_freezeplycolr"], plyTarg["moocow_freezeplycolb"], plyTarg["moocow_freezeplycolg"], plyTarg["moocow_freezeplycola"] = plyTarg:GetColor()
					plyTarg:SetMaterial(useText)
					plyTarg:SetColor(73, 177, 255, 178)
				else
					display(param[1], "freeze", { plyTarg }, parseDisplayMessage(freezeOff, freezeTable))
					plyTarg["moocow_freze"] = -1
					plyTarg:UnLock()
					plyTarg:SetMaterial(plyTarg["moocow_plymat"])
					plyTarg:SetColor(plyTarg["moocow_freezeplycolr"], plyTarg["moocow_freezeplycolg"], plyTarg["moocow_freezeplycolb"], plyTarg["moocow_freezeplycola"])
				end
			end
		end
	end)
end